package qingke.hibernate.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "accommodation")
public class Accommodation {
	@Id
	@Column(name = "id")
	private int id;
	@Column(name = "create_time")
	private int createTime;
	@Column(name = "expire_time")
	private int expireTime;
	
	@ManyToOne
	@JoinColumn(name = "apartment_id")
	private Apartment apartment;
	
	@ManyToOne
	@JoinColumn(name = "student_id")
	private Student student;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getCreateTime() {
		return createTime;
	}

	public void setCreateTime(int createTime) {
		this.createTime = createTime;
	}

	public int getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(int expireTime) {
		this.expireTime = expireTime;
	}

	public Apartment getApartment() {
		return apartment;
	}

	public void setApartment(Apartment apartment) {
		this.apartment = apartment;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Override
	public String toString() {
		return "Accommodation [id=" + id + ", createTime=" + createTime + ", expireTime=" + expireTime + "]";
	}
	
	

	
}
